package com.gitee.feizns.explore.data_structure.linked_list.singly.duplicates;

/**
 * @author feizns
 * @since 2019/9/29
 */
public class ListNode {

    int val;
    ListNode next;

    ListNode(int x) {
        val = x;
        next = null;
    }

    public static ListNode create() {
        ListNode ret = new ListNode(1);
        ret.next = new ListNode(2);
        ret.next.next = ret;
        return ret;
    }

    public void print() {
        ListNode tmp = this;
        while ( tmp != null ) {
            System.out.print(tmp.val + ",");
            tmp = tmp.next;
        }
        System.out.println();
    }

}
